package hu.example.munka_count.model;

import java.text.DecimalFormat;
import java.util.Calendar;

public class DateModel {
	private int id;
	private String currDate;
	private String startMills;
	private String endMills;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getCurrDate() {
		return currDate;
	}

	public void setCurrDate(String currDate) {
		this.currDate = currDate;
	}

	public String getStartMills() {
		return startMills;
	}

	public void setStartMills(String startMills) {
		this.startMills = startMills.toString();
	}

	public String getEndMills() {
		return endMills;
	}

	public void setEndMills(String endMills) {
		this.endMills = endMills;
	}

	public Boolean isWork() {
		return (this.endMills == null) ? true : false;
	}

	public int getHour() {
		Long e = Long.valueOf(this.endMills);
		Long s = Long.valueOf(this.startMills);
		return (int) ((e - s) / 3600000);

	}

	public int getMinute() {
		Long e = Long.valueOf(this.endMills);
		Long s = Long.valueOf(this.startMills);

		return (int) (((e - s) - this.getHour() * 3600000) / 60000);

	}

	public int getSecundum() {
		Long e = Long.valueOf(this.endMills);
		Long s = Long.valueOf(this.startMills);

		return (int) ((((e - s) - this.getHour() * 3600000) - this.getMinute() * 60000) / 1000);

	}
}
